//
//  LikedUserTableViewCell.m
//  TestApplication
//
//  Created by Hanlingyu on 16/9/20.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "LikedUserTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "AllLikedUserContent.h"
@interface LikedUserTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *headerImage;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *starredChannelLabel;
@property (weak, nonatomic) IBOutlet UIImageView *genderImage;
@property (weak, nonatomic) IBOutlet UILabel *followLabel;
@property (weak, nonatomic) IBOutlet UIButton *followButton;
@property (weak, nonatomic) IBOutlet UIImageView *vipImge;

@property (nonatomic, strong) UIButton *button;
@end

@implementation LikedUserTableViewCell

- (void)setLikedUser:(AllLikedUserContent *)likedUser {
    _likedUser = likedUser;
    [_headerImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://qn.zheli.io/%@", _likedUser.avatar]]];
    _nameLabel.text = [NSString stringWithFormat:@"%@", _likedUser.uname];
    _starredChannelLabel.text = [NSString stringWithFormat:@"%@", _likedUser.desc];
    if ([_likedUser.sex isEqualToString:@"2"]) {
        _genderImage.image = [UIImage imageNamed:@"sexFemale"];
    } else {
        _genderImage.image = [UIImage imageNamed:@"sexMale"];
    }
    
    if (_likedUser.isTalent == 1) {
        _vipImge.hidden = NO;
    } else {
        _vipImge.hidden = YES;
    }
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        
    }
    return self;
}
- (IBAction)followTheUser:(UIButton *)followButton {
    _followButton.hidden = YES;
    self.clickFollow();
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _followButton.layer.cornerRadius = 4;
    _followButton.layer.masksToBounds = YES;

}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
